import cv2
import time
# 进行模型迭代检测  star-sift迭代模型检测
img=cv2.imread('timg.jpg')
starttime=time.time()
star=cv2.xfeatures2d.StarDetector_create()
points1=star.detect(img)
sift=cv2.xfeatures2d.SIFT_create()
points2,features=sift.compute(img,points1)
cv2.drawKeypoints(img,points2,img,(0,255,255),cv2.DrawMatchesFlags_DEFAULT)
endtime=time.time()
print('运行的时间是{}'.format(endtime-starttime))
cv2.imshow('mixture',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
print('混合模型的关键点的数目为：{}'.format(len(points2)))
